package com.yc.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.bean.TestDimension;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TestDimensionDao extends BaseMapper<TestDimension> {
    
    /**
     * 根据测评ID查询所有维度
     */
    @Select("SELECT * FROM testDimensions WHERE testId = #{testId} ORDER BY sortOrder ASC")
    List<TestDimension> selectByTestId(@Param("testId") Long testId);
    
    /**
     * 根据维度名称和测评ID查询维度
     */
    @Select("SELECT * FROM testDimensions WHERE testId = #{testId} AND dimensionName = #{dimensionName}")
    TestDimension selectByTestIdAndName(@Param("testId") Long testId, @Param("dimensionName") String dimensionName);
} 